package com.jingzhe.controller.sys;


import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jingzhe.biz.sys.service.ISysUserService;
import com.jingzhe.biz.sys.vo.SysUserResultVo;
import com.jingzhe.biz.sys.vo.SysUserSearchVo;
import com.jingzhe.controller.CommonWeb;
import com.jingzhe.core.web.converter.DataTablesResult;

@Controller
@RequestMapping("/sys/user")
public class UserWeb extends CommonWeb {
	private final static Logger  logger = LoggerFactory.getLogger(UserWeb.class);
	
	@Resource
	private ISysUserService sysUserService;
	
	//用户列表页
    private final static String USER_LIST_PAGE = "sys/user/userList";
	
	/**
     * 跳转到用户列表页
     * @return
     */
    @RequestMapping(value = "", method = RequestMethod.GET)
    public String toUser(HttpServletRequest request) {
        return USER_LIST_PAGE;
    }
    
    /**
     * 根据条件查询用户列表
     * @return
     */
    @RequestMapping(value = "/select-user-list", method = RequestMethod.GET)
    @ResponseBody
    public DataTablesResult<SysUserResultVo> selectUserList(SysUserSearchVo searchVo) {
    	return new DataTablesResult<SysUserResultVo>(searchVo.getDraw(), sysUserService.selectUserList(searchVo));
    }
    
}
